#!/bin/bash

setup_ssh()
{
    if [ ! -e /var/lib/rancher/k3os/ssh ]; then
        mkdir -p /var/lib/rancher/k3os
        cp -rf /etc/ssh /var/lib/rancher/k3os/ssh
    fi
    rm -rf /etc/ssh
    ln -s /var/lib/rancher/k3os/ssh /etc/ssh
}

setup_rancher_node()
{
    mkdir -p /etc/rancher
    mkdir -p /var/lib/rancher/k3os/node
    ln -s /var/lib/rancher/k3os/node /etc/rancher/
}

setup_ssh
setup_rancher_node
